<!DOCTYPE html>
<!--在静态页面中要引入thymeleaf引擎技术的命名空间-->
<html lang="en" xmlns:th='http://www.thymeleaf.org'>
<head>
    <meta charset="UTF-8">
    <title>UserListInformation</title>
</head>
<body>
<div>
    <center>
        <h1>Userlist</h1>
        <table border="2">
            <tr>
                <td>username</td>
                <td>password</td>
                <td>sex</td>
                <td>age</td>
                <td>handle</td>
            </tr>

            <!-- th:each 相当于 for(User user : users)-->
            <tr th:each="user:${users}">
                <!--最终当thymeleaf解析到该标签时，会用text获取到的值替换原本的文本-->
                <td th:text="${user.getUsername()}">张三</td>
                <td th:text="${user.getPassword()}">123456</td>
                <td th:text="${user.getSex()}">男</td>
                <td th:text="${user.getAge()}">15</td>
                <td><a th:href="@{'toUpdate.do?user='+${user.getUsername()}
                                   +'&pwd='+${user.getPassword()}
                                   +'&sex='+${user.getSex()}
                                   +'&age='+${user.getAge()}}">change</a></td>
            </tr>

            <!-- th:remove="all" 表示当thymeleaf解析到该标签时，会将该标签以及子标签隐藏-->
            <tr th:remove="all">
                <td>李四</td>
                <td>1222456</td>
                <td>女</td>
                <td>18</td>
                <td><a>修改信息</a></td>
            </tr>

            <tr th:remove="all">
                <td>王五</td>
                <td>123456</td>
                <td>男</td>
                <td>15</td>
                <td><a>修改信息</a></td>
            </tr>
        </table>
        <a href="index.html">back</a>
    </center>
</div>
</body>
</html>